package com.laow.service.impl;

import com.laow.dao.EbookDao;
import com.laow.entity.EbookCategory;
import com.laow.entity.EbookEntry;
import com.laow.service.EbookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ebookServiceImpl")
public class EbookServiceImpl implements EbookService {


    @Autowired
    @Qualifier("ebookDaoImpl")
    private EbookDao ebookDao;


    @Override
    public List<EbookCategory> getCategorys() {
        return ebookDao.getCategorys();
    }

    @Override
    public List<EbookEntry> ebookEntrys(int categoryId, int currentPage) {
        return ebookDao.ebookEntrys(categoryId,currentPage);
    }

    @Override
    public EbookEntry ebookEntryToId(int id) {
        return ebookDao.ebookEntryToId(id);
    }

    @Override
    public boolean delEntryData(EbookEntry ebookEntry) {
        return ebookDao.delEntryData(ebookEntry);
    }

    @Override
    public boolean udpEntryData(EbookEntry ebookEntry) {
        return ebookDao.udpEntryData(ebookEntry);
    }

    @Override
    public Object addEntryData(EbookEntry ebookEntry) {
        return ebookDao.addEntryData(ebookEntry);
    }

    @Override
    public int selEbookEntryDataCount(int categoryId) {
        return ebookDao.selEbookEntryDataCount(categoryId);
    }
}
